import request from '@/utils/request'
// 1,获取所有组织架构的列表
export function reqGetDeparments() {
  return request({
    method: 'get',
    url: '/company/department'
  })
}

// 2,根据id 删除部门
export function reqDelDepartment(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

// 3,点击添加部门获取信息
export function reqAddDepartment(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 4,根据id获取部门详情
export function reqGetDepartDetail(id) {
  return request({
    // 默认get方式请求
    url: `/company/department/${id}`
  })
}

// 5,根据id更新部门
export function reqUpdateDepartments(form) {
  return request({
    url: `/company/department/${form.id}`,
    method: 'put',
    data: form
  })
}
